package cn.silver.module.monitor.param;

import cn.silver.framework.core.utils.DateUtils;
import cn.silver.framework.mybatis.annotation.TableField;
import cn.silver.framework.mybatis.enums.SearchTypeEnums;
import cn.silver.framework.mybatis.param.BaseParam;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.util.Date;

/**
 * 操作日志记录业务对象 sys_oper_log
 *
 * @author Michelle.Chung
 * @date 2023-02-07
 */

@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "OperParam", title = "操作日志查询条件")
public class OperParam extends BaseParam {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(title = "登录账号")
    @TableField(name = "user_code", searchType = SearchTypeEnums.LIKE)
    private String userCode;

    @Schema(title = "登录人")
    @TableField(name = "user_name", searchType = SearchTypeEnums.LIKE)
    private String userName;
    /**
     * 模块标题
     */
    @Schema(title = "模块编码")
    @TableField(name = "module_code", searchType = SearchTypeEnums.EQ)
    private String moduleCode;

    /**
     * 模块标题
     */
    @Schema(title = "模块标题")
    @TableField(name = "module_name", searchType = SearchTypeEnums.LIKE)
    private String moduleName;

    @Schema(title = "授权类型")
    @TableField(name = "bus_type", searchType = SearchTypeEnums.EQ)
    private String busType;

    @Schema(title = "操作类型")
    @TableField(name = "oper_type", searchType = SearchTypeEnums.EQ)
    private String operType;

    @Schema(title = "设备类型")
    @TableField(name = "device_type", searchType = SearchTypeEnums.EQ)
    private String deviceType;

    @Schema(title = "操作结果")
    @TableField(name = "result", searchType = SearchTypeEnums.EQ)
    private String result;

    /**
     * 访问时间
     */
    @Schema(title = "操作时间")
    @TableField(name = "oper_time", searchType = SearchTypeEnums.BETWEEN)
    @JsonFormat(timezone = DateUtils.TIME_ZONE, pattern = DateUtils.YYYY_MM_DD_HH_MM_SS)
    private Date operTime;

    /**
     * 租户编号
     */
    @Schema(title = "租户编号")
    @TableField(name = "tenant_id", searchType = SearchTypeEnums.EQ)
    private String tenantId;
}
